package net.lab1024.sa.admin.module.app.user;

import java.util.List;

import net.lab1024.sa.admin.module.app.user.domain.UserEntity;
import net.lab1024.sa.admin.module.app.user.domain.UserQueryForm;
import net.lab1024.sa.admin.module.app.user.domain.UserVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * app小程序用户 Dao
 *
 * @Author M
 * @Date 2024-10-18 20:45:17
 * @Copyright Transmute实验室
 */

@Mapper
@Component
public interface UserDao extends BaseMapper<UserEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<UserVO> queryPage(Page<?> page, @Param("queryForm") UserQueryForm queryForm);

    /**
     * 更新删除状态
     */
    long updateDeleted(@Param("userId") Long userId,@Param("deletedFlag") Boolean deletedFlag);
    /**
     * 批量更新删除状态
     */
    void batchUpdateDeleted(@Param("idList") List<Long> idList, @Param("deletedFlag") Boolean deletedFlag);

    /** 根据用户名获取信息 */
    UserEntity getByUserName(@Param("userName") String userName);
}
